<%@ page pageEncoding="UTF-8"%>

<%@ taglib uri="/tags/struts-tiles" prefix="tiles"%>
<%@ taglib uri="/tags/struts-html" prefix="html"%>
<%@ taglib uri="/tags/struts-logic" prefix="logic"%>
<%@ taglib uri="/tags/struts-nested" prefix="nested"%>
<%@ taglib uri="/tags/struts-bean" prefix="bean"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="/tags/trymore" prefix="tm"%>

<script type="text/javascript">
	function after_save(json) {
		DWZ.ajaxDone(json);
		var currentPanel = $(navTab.getCurrentPanel());
		if ($("#_var_dictype", currentPanel).size() > 0) {
			var dict_type = $("#_var_dictype", currentPanel).val();
			$("#datagrid_dict_item").loadUrl("app/system/dict.do?action=actionLoadDictDataGrid&type=" + dict_type, {}, function(){
				$.pdialog.closeCurrent();
			});
		}
	}
	$(function(){
		$.each($("textarea", $("#formDict")), function(){
			$(this).html($(this).text().replace(/<br\/>/g,"\n"));
		});
	});
</script>

<div class="pageContent">
	<form method="post" action="app/system/dict.do?action=actionSavaDict" class="pageForm required-validate" onsubmit="return validateCallback(this, after_save);" id="formDict">
		<div class="pageFormContent" layoutH="56">
			<table cellspacing="10" cellpadding="10" class="dform">
				<tr>
					<td>数据名称：</td>
					<td><input name="dictKey" type="text" size="30" value="${entity ne null ? entity.dictKey : ''}" class="required" style="width: 88%" /></td>
				</tr>
				<tr>
					<td>数据值：</td>
					<td><input name="dictValue" error_message="该数据值已存在..." type="text" size="30" value="${entity ne null ? entity.dictValue : ''}" class="required" style="width: 88%" remote="app/system/dict.do?action=actionUniqueCheckValueByDictType&dictType=${entity ne null ? entity.dictType : type}&dictId=${entity ne null ? entity.id : '-1'}&force_ajax" /></td>
				</tr>
				<tr>
					<td style="vertical-align: top;">数据描述：</td>
					<td>
						<textarea rows="2" cols="40" name="dictDesc" class="textInput" style="width: 88%">${entity ne null ? entity.dictDesc : ''}</textarea>
					</td>
				</tr>
			</table>
		</div>
		<div class="formBar">
			<ul>
				<li>
					<div class="buttonActive"><div class="buttonContent"><button type="submit">保存</button></div></div>
				</li>
				<li>
					<div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div>
				</li>
			</ul>
		</div>
		<input type="hidden" name="dictType" value="${entity ne null ? entity.dictType : type}" />
		<input type="hidden" name="id" value="${entity ne null ? entity.id : '-1'}" />
	</form>
<div>